package cn.auto.controller;

import java.util.HashMap;
import java.util.List;

import com.jfinal.core.ActionKey;

import cn.auto.service.RuninfoService;
import cn.auto.utility.HelperController;
import cn.auto.utility.Status;

public class RuninfoController extends HelperController {
	
	RuninfoService service=new RuninfoService();
	
	public void index() {
		String pid=getPara("pid");
		String rid=getPara("rid");
		HashMap<Object, Object> result=service.getCaseWaitRun(pid, rid);
		String st = (String) result.get("status"); 
		HashMap<String, String> msg=new HashMap<>();
		msg.put(Status.SUCCESS, "获取成功!");
		msg.put(Status.NORECORD, "无记录!");
		msg.put(Status.FAILED, "获取失败!");
		responseResult(st, msg, (List<?>) result.get("body"));
	}
	
	@ActionKey("/getRuninfo")
	public void getRuninfo() {
		String id=getPara("id");
		HashMap<Object, Object> result=service.getRuninfo(id);
		String st = (String) result.get("status"); 
		HashMap<String, String> msg=new HashMap<>();
		msg.put(Status.SUCCESS, "获取成功!");
		msg.put(Status.NORECORD, "无记录!");
		msg.put(Status.FAILED, "获取失败!");
		responseResult(st, msg, result.get("body"));
	}
	
}
